<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
    </div>
    <script src="/xuni/bundle.js"></script>
    <script>
        const str = `   
        <div>
        我买了一个{{thing}},价格是{{price.p.p1}}
        </div>
        <ul>
            {{#student}}
                <li>{{name}}</li>
                <li>      
                    <ol>
                        {{#hobbies}}
                            <ol>{{.}}</ol>
                        {{/hobbies}}
                    </ol>
                </li>
            {{/student}}
        </ul>
        `
        var data = {
            thing: "东西",
            price: {
                p: {
                    p1: 100
                }
            },
            student: [{
                    name: "ccc",
                    hobbies: [1, 2, 3]
                },
                {
                    name: "ddd",
                    hobbies: [1, 2, 3]
                }
            ]
        }
        const template = window.sgg_template.render(str, data)
        // console.log(template)
        const box = document.getElementById('app')
        // console.log(box)
        box.innerHTML = template
    </script>
</body>

</html>